package cn.com.cpic.insurance.rulecheck.core.rule;

import java.util.Map;

/**
 * 
 * 
 * @author 代波
 * @since 2011-8-21
 */
public final class ExtExpressionRuleConsumer extends ExpressionRuleConsumer {
	private static final long serialVersionUID = -2400889293775749088L;

	private final Map<String, String> bomNameMap;

	public ExtExpressionRuleConsumer(String token, String expression, Map<String, String> bomNameMap, String... tags) {
		super(token, expression, tags);
		this.bomNameMap = bomNameMap;
	}

	@Override
	protected boolean isRequired(String bom) {
		return bomNameMap.containsKey(bom);
	}

	@Override
	protected String getBomName(String bom) {
		return bomNameMap.containsKey(bom) ? bomNameMap.get(bom) : bom;
	}
}
